package com.fenda.mybleapplication;

import android.app.Application;
import android.os.Environment;
import android.util.Log;

import com.dragon.utilslibrary.AppConfig;

import java.io.File;


public class AllApplication extends Application {

    private final boolean isDebugARouter = true;
    private static final String TAG = "jett";

    @Override
    public void onCreate() {
        super.onCreate();

        File file = new File(Environment.getExternalStorageDirectory(), "app1.trace");
        Log.i(TAG, "onCreate: " + file.getAbsolutePath());
        //把分析结果存在一个文件
//        Debug.startMethodTracing(file.getAbsolutePath());


        AppConfig.rootFile = "MyBle";
        AppConfig.apkFileName = "ble.apk";
        AppConfig.init(getApplicationContext());

        new Thread(){
            @Override
            public void run() {
                //如果要用线程来节约了这些初始化的时间
                //1.里面的API不能去创建handler
                //2.不能有UI操作
                //3.对异步要求不高
//                initNim();
//                initImagePicker();
//                initOkHttp();//可以懒加载
            }
        }.start();

//        if (isDebugARouter) {
//            ARouter.openLog();
//            ARouter.openDebug();
//        }
//        ARouter.init(AllApplication.this);

//        Debug.stopMethodTracing();
    }
}
